package com.zq.widget.inverted.game.role.equipment.weapon.gun.bullet;

import android.content.Context;
import android.graphics.RectF;

import com.zq.widget.inverted.R;
import com.zq.widget.inverted.game.role.Role;
import com.zq.widget.inverted.game.role.damage.DamageProxy;
import com.zq.widget.inverted.game.role.equipment.weapon.gun.BulletFactory;
import com.zq.widget.inverted.game.role.equipment.weapon.gun.Gun;
import com.zq.widget.inverted.game.role.hp.HPProxy;
import com.zq.widget.inverted.game.role.impl.plane.PlaneBoss;

/**
 * Created by zhangqiang on 2018/4/4.
 */
public class BossBulletFactory implements BulletFactory{

    private PlaneBoss boss;

    public BossBulletFactory(PlaneBoss boss) {
        this.boss = boss;
    }

    @Override
    public Role[] create(Gun gun) {

        Context context = boss.getContext();

        Role[] roles = new Role[10];
        for (int i = 0; i < roles.length; i++) {

            int degree = 12 * i + 210;
            Bullet bullet = new Bullet(context,R.drawable.point);
            bullet.setVelocity(500);
            bullet.setDegree(degree);
            bullet.setHpProxy(new HPProxy(1));
            bullet.setDamageProxy(new DamageProxy(1));
            bullet.setStartPoint(gun.shootPoint());
            bullet.locationOffset(0,roles[i].bounds().height()/2 + 10);
            roles[i] = bullet;
        }
        return roles;
    }
}
